package com.org.entity.sys;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.org.entity.base.BaseEntity;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Data
@Table(name = "SYS_ROLE_USER")
public class SysRoleUser extends BaseEntity {

    /**
     * 用户Id
     */
    @Column(name = "FK_USER_ID")
    private String fkUserId;

    /**
     * 角色Id
     */
    @Column(name = "FK_ROLE_ID")
    private String fkRoleId;

    /**
     * 用户姓名
     */
    @Transient
    private String userName;

    /**
     * 登录账号
     */
    @Transient
    private String loginCode;

    /**
     * 用户邮箱
     */
    @Transient
    private String email;

    /**
     * 手机号码
     */
    @Transient
    private String phone;

    /**
     * 性别
     */
    @Transient
    private int sex;

    /**
     * 用户状态
     */
    @Transient
    private int state;

    /**
     * 注册时间
     */
    @Transient
    @CreatedDate
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date addTime;

    /**
     * 角色名称
     */
    @Transient
    private String roleName;
}


